package com.common.repository.casemanage;

import com.common.entity.casemanage.CaseProblemSituationEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author johnny
 */
public interface CaseProblemSituationRepository extends JpaRepository<CaseProblemSituationEntity, Long> {


    List<CaseProblemSituationEntity> findByParentIdIsNullAndTypeOrderByIdDesc(String type);

    List<CaseProblemSituationEntity> findByParentIdOrderByIdDesc(Long id);


    List<CaseProblemSituationEntity> findByParentIdAndTypeOrderByIdDesc(Long problemId, String type);


    CaseProblemSituationEntity findByParentId(Long parentId);

    CaseProblemSituationEntity findByIdAndType(Long id , String type);

    void deleteByParentIdAndType(Long parentId , String type);

    void deleteByIdAndType(Long id , String type);
}